package fr.charlott.batch.writer;

import java.util.List;

import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Autowired;

import fr.charlott.core.repository.model.Hotesse;
import fr.charlott.core.service.HotesseService;

public class HotesseWriter implements ItemWriter<Hotesse>{

	@Autowired
	private HotesseService hotesseService;
	

	@Override
	public void write(List<? extends Hotesse> items) throws Exception {
		for (Hotesse hotesse : items) {
			hotesseService.ajouterHotesse(hotesse);
		}
	}

	public void setHotesseService(HotesseService hotesseService) {
		this.hotesseService = hotesseService;
	}
}
